package hsqldb;

import org.hsqldb.util.DatabaseManagerSwing;

import java.sql.*;

public class HSQLDB_Client {
	public static void main(String[] args) {
		DatabaseManagerSwing.main(args);

		//test();
	}

	public static void test(){
		try {
			Class.forName("org.hsqldb.jdbcDriver");

			String url = "jdbc:hsqldb:file:d:/hsqldb/test;shutdown=true";
			System.out.println(0);
			Connection c = DriverManager.getConnection(url, "root", "admin");
			System.out.println("1");
			Statement st = c.createStatement();
			System.out.println("2");
			ResultSet rs= st.executeQuery("select * from category");
			while(rs.next()){
				int id = rs.getInt("id");
				String name = rs.getString("name");
				System.out.println(id+"\t"+name);
			}
			System.out.println("3");
			st.close();
			c.close();
			System.out.println("4");
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
}
